package com.hdc.hdc.warehouseManage.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.hdc.hdc.warehouseManage.entity.GoodsTrade;
import com.hdc.hdc.warehouseManage.repository.base.BaseJpaRespository;

public interface WareHouseRepository extends BaseJpaRespository<GoodsTrade, String>{

	@Query(nativeQuery=true,value="update goods_trade g set g.goods_location_id =:locationId,"
			+ "g.goods_location_name =:locationName,g.warning_value =:warningValue,g.update_date =:updateDate "
			+ " where g.id =:id ")
	@Modifying
	public void updateGoodsByVO(@Param("id")String id, @Param("locationId")String locationId, 
			@Param("locationName")String locationName, @Param("warningValue")Long warningValue,
			@Param("updateDate")Date updateDate);

	public List<GoodsTrade> findByHouseIdAndPositionIdAndLocationId(@Param("houseId")String houseId, 
			@Param("positionId")String positionId,@Param("locationId")String locationId);
	

}
